from PySide2 import QtCore
from PySide2.QtWidgets import QLabel


class MyLabel(QLabel):
    # 自定义信号, 注意信号必须为类属性
    button_clicked_signal = QtCore.Signal(str)


    def mouseDoubleClickEvent(self, QMouseEvent):
        self.button_clicked_signal.emit()

    # 可在外部与槽函数连接
    def connect_customized_slot(self, func):
        self.button_clicked_signal.connect(func)
